package com.example.design.bilibili.mediator;

public class CoffeeMachine extends Colleague{

    public CoffeeMachine(Mediator mediator, String name) {
        super(mediator, name);
        mediator.Register(name,this);
    }

    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().GetMessage(stateChange,this.name);
    }

    public void startCoffee(){
        System.out.println("It is time to startcoffee!");
    }

    public void finishCoffee(){
        System.out.println("After 5 minute !");
        System.out.println("Coffee is ok");
        sendMessage(0);
    }
}
